#ifndef CODEPASTECONFIG_H_INCLUDED
#define CODEPASTECONFIG_H_INCLUDED

// For compilers that support precompilation, includes <wx/wx.h>
#include <wx/wxprec.h>

#ifndef WX_PRECOMP
   #include <wx/wx.h>
#endif

#include <configurationpanel.h>  // for cbConfigurationPanel
#include "cpgPanel.h"

struct PastebinSyntax
{
   wxString language;
   wxString code;
};

struct PastebinExpiration
{
   wxString expires;
   wxString code;
};

static const unsigned int numSyntaxes = 189;
static const PastebinSyntax syntaxes[] =
{
   { _T("Plain text (none)"), _T("text") },
   { _T("4CS"), _T("4cs") },
   { _T("6502 ACME Cross Assembler"), _T("6502acme") },
   { _T("6502 Kick Assembler"), _T("6502kickass") },
   { _T("6502 TASM/64TASS"), _T("6502tasm") },
   { _T("ABAP"), _T("abap") },
   { _T("ActionScript"), _T("actionscript") },
   { _T("ActionScript 3"), _T("actionscript3") },
   { _T("Ada"), _T("ada") },
   { _T("ALGOL 68"), _T("algol68") },
   { _T("Apache Log"), _T("apache") },
   { _T("AppleScript"), _T("applescript") },
   { _T("APT Sources"), _T("apt_sources") },
   { _T("ASM (NASM)"), _T("asm") },
   { _T("ASP"), _T("asp") },
   { _T("autoconf"), _T("autoconf") },
   { _T("Autohotkey"), _T("autohotkey") },
   { _T("AutoIt"), _T("autoit") },
   { _T("Avisynth"), _T("avisynth") },
   { _T("Awk"), _T("awk") },
   { _T("Bash"), _T("bash") },
   { _T("Basic4GL"), _T("basic4gl") },
   { _T("BibTeX"), _T("bibtex") },
   { _T("Blitz Basic"), _T("blitzbasic") },
   { _T("BNF"), _T("bnf") },
   { _T("BOO"), _T("boo") },
   { _T("BrainFuck"), _T("bf") },
   { _T("C"), _T("c") },
   { _T("C for Macs"), _T("c_mac") },
   { _T("C Intermediate Language"), _T("cil") },
   { _T("C#"), _T("csharp") },
   { _T("C++"), _T("cpp") },
   { _T("C++ (with Qt extensions)"), _T("cpp-qt") },
   { _T("CAD DCL"), _T("caddcl") },
   { _T("CAD Lisp"), _T("cadlisp") },
   { _T("CFDG"), _T("cfdg") },
   { _T("ChaiScript"), _T("chaiscript") },
   { _T("Clojure"), _T("clojure") },
   { _T("Clone C"), _T("klonec") },
   { _T("Clone C++"), _T("klonecpp") },
   { _T("CMake"), _T("cmake") },
   { _T("COBOL"), _T("cobol") },
   { _T("ColdFusion"), _T("coldfusion") },
   { _T("CSS"), _T("css") },
   { _T("Cuesheet"), _T("cuesheet") },
   { _T("D"), _T("d") },
   { _T("DCS"), _T("dcs") },
   { _T("Delphi"), _T("delphi") },
   { _T("Delphi Prism (Oxygene)"), _T("oxygene") },
   { _T("Diff"), _T("diff") },
   { _T("DIV"), _T("div") },
   { _T("DOS"), _T("dos") },
   { _T("DOT"), _T("dot") },
   { _T("E"), _T("e") },
   { _T("ECMAscript"), _T("ecmascript") },
   { _T("Eiffel"), _T("eiffel") },
   { _T("Email"), _T("email") },
   { _T("Erlang"), _T("erlang") },
   { _T("F#"), _T("fsharp") },
   { _T("FO Language"), _T("fo") },
   { _T("Formula One"), _T("f1") },
   { _T("Fortran"), _T("fortran") },
   { _T("FreeBasic"), _T("freebasic") },
   { _T("GAMBAS"), _T("gambas") },
   { _T("Game Maker"), _T("gml") },
   { _T("GDB"), _T("gdb") },
   { _T("Genero"), _T("genero") },
   { _T("Genie"), _T("genie") },
   { _T("GetText"), _T("gettext") },
   { _T("Go"), _T("go") },
   { _T("Groovy"), _T("groovy") },
   { _T("GwBasic"), _T("gwbasic") },
   { _T("Haskell"), _T("haskell") },
   { _T("HicEst"), _T("hicest") },
   { _T("HQ9 Plus"), _T("hq9plus") },
   { _T("HTML"), _T("html4strict") },
   { _T("Icon"), _T("icon") },
   { _T("IDL"), _T("idl") },
   { _T("INI file"), _T("ini") },
   { _T("Inno Script"), _T("inno") },
   { _T("INTERCAL"), _T("intercal") },
   { _T("IO"), _T("io") },
   { _T("J"), _T("j") },
   { _T("Java"), _T("java") },
   { _T("Java 5"), _T("java5") },
   { _T("JavaScript"), _T("javascript") },
   { _T("jQuery"), _T("jquery") },
   { _T("KiXtart"), _T("kixtart") },
   { _T("LaTeX"), _T("latex") },
   { _T("Liberty BASIC"), _T("lb") },
   { _T("Linden Scripting"), _T("lsl2") },
   { _T("Lisp"), _T("lisp") },
   { _T("Loco Basic"), _T("locobasic") },
   { _T("Logtalk"), _T("logtalk") },
   { _T("LOL Code"), _T("lolcode") },
   { _T("Lotus Formulas"), _T("lotusformulas") },
   { _T("Lotus Script"), _T("lotusscript") },
   { _T("LScript"), _T("lscript") },
   { _T("Lua"), _T("lua") },
   { _T("M68000 Assembler"), _T("m68k") },
   { _T("MagikSF"), _T("magiksf") },
   { _T("Make"), _T("make") },
   { _T("MapBasic"), _T("mapbasic") },
   { _T("MatLab"), _T("matlab") },
   { _T("mIRC"), _T("mirc") },
   { _T("MIX Assembler"), _T("mmix") },
   { _T("Modula 2"), _T("modula2") },
   { _T("Modula 3"), _T("modula3") },
   { _T("Motorola 68000 HiSoft Dev"), _T("68000devpac") },
   { _T("MPASM"), _T("mpasm") },
   { _T("MXML"), _T("mxml") },
   { _T("MySQL"), _T("mysql") },
   { _T("newLISP"), _T("newlisp") },
   { _T("NullSoft Installer"), _T("nsis") },
   { _T("Oberon 2"), _T("oberon2") },
   { _T("Objeck Programming Language"), _T("objeck") },
   { _T("Objective C"), _T("objc") },
   { _T("OCaml Brief"), _T("ocaml-brief") },
   { _T("OCaml"), _T("ocaml") },
   { _T("OpenBSD PACKET FILTER"), _T("pf") },
   { _T("OpenGL Shading"), _T("glsl") },
   { _T("OpenOffice BASIC"), _T("oobas") },
   { _T("Oracle 11"), _T("oracle11") },
   { _T("Oracle 8"), _T("oracle8") },
   { _T("Oz"), _T("oz") },
   { _T("Pascal"), _T("pascal") },
   { _T("PAWN"), _T("pawn") },
   { _T("PCRE"), _T("pcre") },
   { _T("Per"), _T("per") },
   { _T("Perl"), _T("perl") },
   { _T("Perl 6"), _T("perl6") },
   { _T("PHP"), _T("php") },
   { _T("PHP Brief"), _T("php-brief") },
   { _T("Pic16"), _T("pic16") },
   { _T("Pike"), _T("pike") },
   { _T("Pixel Bender"), _T("pixelbender") },
   { _T("PL/SQL"), _T("plsql") },
   { _T("PostgreSQL"), _T("postgresql") },
   { _T("POV-Ray"), _T("povray") },
   { _T("Power Shell"), _T("powershell") },
   { _T("PowerBuilder"), _T("powerbuilder") },
   { _T("Progress"), _T("progress") },
   { _T("Prolog"), _T("prolog") },
   { _T("Properties"), _T("properties") },
   { _T("ProvideX"), _T("providex") },
   { _T("PureBasic"), _T("purebasic") },
   { _T("Python"), _T("python") },
   { _T("q/kdb+"), _T("q") },
   { _T("QBasic"), _T("qbasic") },
   { _T("R"), _T("rsplus") },
   { _T("Rails"), _T("rails") },
   { _T("REBOL"), _T("rebol") },
   { _T("REG"), _T("reg") },
   { _T("Robots"), _T("robots") },
   { _T("RPM Spec"), _T("rpmspec") },
   { _T("Ruby"), _T("ruby") },
   { _T("Ruby GnuPlot"), _T("gnuplot") },
   { _T("SAS"), _T("sas") },
   { _T("Scala"), _T("scala") },
   { _T("Scheme"), _T("scheme") },
   { _T("Scilab"), _T("scilab") },
   { _T("SdlBasic"), _T("sdlbasic") },
   { _T("Smalltalk"), _T("smalltalk") },
   { _T("Smarty"), _T("smarty") },
   { _T("SQL"), _T("sql") },
   { _T("SystemVerilog"), _T("systemverilog") },
   { _T("T-SQL"), _T("tsql") },
   { _T("TCL"), _T("tcl") },
   { _T("Tera Term"), _T("teraterm") },
   { _T("thinBasic"), _T("thinbasic") },
   { _T("TypoScript"), _T("typoscript") },
   { _T("Unicon"), _T("unicon") },
   { _T("Vala"), _T("vala") },
   { _T("VB.NET"), _T("vbnet") },
   { _T("VeriLog"), _T("verilog") },
   { _T("VHDL"), _T("vhdl") },
   { _T("VIM"), _T("vim") },
   { _T("Visual Pro Log"), _T("visualprolog") },
   { _T("VisualBasic"), _T("vb") },
   { _T("VisualFoxPro"), _T("visualfoxpro") },
   { _T("WhiteSpace"), _T("whitespace") },
   { _T("WHOIS"), _T("whois") },
   { _T("Win Batch"), _T("winbatch") },
   { _T("XBasic"), _T("xbasic") },
   { _T("XML"), _T("xml") },
   { _T("Xorg Config"), _T("xorg_conf") },
   { _T("XPP"), _T("xpp") },
   { _T("Z80 Assembler"), _T("z80") },
   { _T("ZXBasic"), _T("zxbasic") }
};

static const unsigned int numExpirations = 7;
static const PastebinExpiration expirations[] =
{
   { _T("Never"), _T("N") },
   { _T("Ten Minutes"), _T("10M") },
   { _T("One Hour"), _T("1H") },
   { _T("One Day"), _T("1D") },
   { _T("One Week"), _T("1W") },
   { _T("Two Weeks"), _T("2W") },
   { _T("One Month"), _T("1M") }
};

struct CodePasteSettings
{
   // pastebin.com settings
   wxString dev_key;
   wxString default_title;
   int syntax_choice;
   int exposure_choice;
   int expiration_choice;
   // network settings
   int timeout;
   // behavior settings
   bool confirm_title;
   bool auto_syntax;
   bool copy_to_clipboard;
   bool open_in_browser;
};

class CodePasteConfigurationPanel : public cbConfigurationPanel
{
public:
   CodePasteConfigurationPanel(wxWindow *parent, CodePasteSettings *settings);
   virtual ~CodePasteConfigurationPanel();

   virtual wxString GetTitle() const { return _T("CodePaste Settings"); }
   virtual wxString GetBitmapBaseName() const { return _T("CodePaste"); }

   virtual void Sync();

   virtual void OnApply();
   virtual void OnCancel();

private:
   cpgPanel *thePanel;
   CodePasteSettings *set;

   DECLARE_EVENT_TABLE();
};

#endif

